package dq.study.designmodel.strategy;

/**
 * @author dongqun
 * @Description: 策略实现1
 * @date 2019/4/10 21:33
 */
public class BMIComartor implements Compartor<Cat> {

    @Override
    public int compare(Cat t1, Cat t2) {
        if ((t1.getHeight()/t1.getWeight())>(t2.getHeight()/t2.getWeight())){
            return 1;
        }else if ((t1.getHeight()/t1.getWeight())<(t2.getHeight()/t2.getWeight())){
            return -1;
        }
        return 0;
    }
}
